<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>多列布局案例</title>
    <style>
        .box{
            column-count: 5;
            background-image: url(images/a.png);
        }
        .box img{
            width: 100%;
            
        }
        .box div{
            border: 3px solid green;
            padding: 5px;
            margin-bottom: 10px;

            break-inside: avoid;
            /* 禁止盒子内部折行 */
        }

        .box div p{
            line-height: 30px;
            text-align: center;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div>
            <img src="images/1.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/2.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/3.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/4.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/5.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/6.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/7.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/8.jpg" alt="">
            <p>赵钱孙李</p>
        </div>

        <div>
            <img src="images/9.jpg" alt="">
            <p>赵钱孙李</p>
        </div><div>
            <img src="images/10.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/11.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/12.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/13.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/14.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
        <div>
            <img src="images/15.jpg" alt="">
            <p>赵钱孙李</p>
        </div>
    </div>
</body>
</html>